#include "BossHand.h"
#include "Box.h"

#include "ShareComponents.h"
#include "MainGame.h"
#include "RSManager.h"
#include "Sprite.h"

BossHand::BossHand(Box* box):Arm(box->_position,0,0,0,0,0)
{
	init();
}


BossHand::~BossHand(void)
{
}

void BossHand::init()
{
	_box->_size.x = _box->_size.y = 32;
	_box->_v.x = _box->_v.y = 0;
	_colBox->_size.x =_colBox->_size.y = 32;	
	_isAlive = true;
	_hits = 10;
	_sprite = RSManager::getInstance()->getSprite(ARM_HAND);
}

void BossHand::update()
{
	_colBox->_v = _parent->_position - _box->_position;
	_box->_position = _parent->_position;
	_colBox->_position = _parent->_position;
	if(_hits < 0)
	{
		gl_MainGame->removeWorldObject(this);
		_isAlive = false;
	}
}

void BossHand::render()
{
	_sprite->Render(_box->_position);
}

Box* BossHand::getCollisionBox()
{
	return _colBox;
}
